﻿using System;
using System.ComponentModel;

namespace NCT.Entity
{
    public class Item : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        string type;
        string key;
        string name;
        string url;
        string singer;
        string poster;
        string liked;
        string listen;
        string imageUrl;

        public string Info()
        {
            return Name + " - " + Singer;
        }

        public string Type
        {
            get { return type; }
            set 
            {
                if (type != value)
                {
                    type = value;
                    OnPropertyChanged("type");
                }
            }
        }

        public string Key
        {
            set
            {
                if (key != value)
                {
                    key = value;
                    OnPropertyChanged("Key");
                }
            }
            get
            {
                return key;
            }
        }

        public string Name
        {
            set
            {
                if (name != value)
                {
                    name = value;
                    OnPropertyChanged("Name");
                }
            }
            get
            {
                return name;
            }
        }

        public string Url
        {
            set
            {
                if (url != value)
                {
                    url = value;
                    OnPropertyChanged("Url");
                }
            }
            get
            {
                return url;
            }
        }

        public string Singer
        {
            set
            {
                if (singer != value)
                {
                    singer = value;
                    OnPropertyChanged("Singer");
                }
            }
            get
            {
                return singer;
            }
        }

        public string Poster
        {
            set
            {
                if (poster != value)
                {
                    poster = value;
                    OnPropertyChanged("Poster");
                }
            }
            get
            {
                return poster;
            }
        }

        public string Liked
        {
            set
            {
                if (liked != value)
                {
                    liked = value;
                    OnPropertyChanged("Liked");
                }
            }
            get
            {
                return liked;
            }
        }
        
        public string ImageUrl
        {
            set
            {
                if (imageUrl != value)
                {
                    imageUrl = value;
                    OnPropertyChanged("ImageUrl");
                }
            }
            get
            {
                return imageUrl;
            }
        }
    
        public string Listen
        {
            set
            {
                if (listen != value)
                {
                    listen = value;
                    OnPropertyChanged("Listen");
                }
            }
            get
            {
                return listen;
            }
        }

        protected virtual void OnPropertyChanged(string propChanged)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propChanged));
        }

    }
}
